Repository navigation
[Bugfix #1941] consult claude lane: mode-aware login advice, set-based tool guard, npm install hint, configurable caps, docs - #1942
Draft
waleedkadous wants to merge 7 commits into
Draft
waleedkadous wants to merge 7 commits into
waleedkadous wants to merge 7 commits into
Conversation
…install hint, caps, docs) - A logged-out answer gets the remedy for the auth mode: `claude auth login` in login mode, the key and consult.claudeAuth in api-key mode. Applies to the auth-status preflight, codev doctor, and a review result that says the session is not logged in (claudeLoginRemedy). - The init tool guard compares tool lists as sets: a duplicate is fine; an extra or a missing tool still aborts the review. - CLAUDE_INSTALL_HINT names both the native installer and npm. - consult.claudeMaxTurns / consult.claudeMaxBudgetUsd make the 200-turn and $25 caps configurable, validated at config load; cap-reached messages name the configured value and the key to raise. - Docs: claude 2.1.141 minimum in README/INSTALL; withholding the API key is a billing guarantee, not secrecy (consult.md, consult SKILL.md, arch.md).
…onfigurable caps - Logged-out auth status and a logged-out review result, in each auth mode (lane, preflight and doctor); an unrelated error result gets no remedy. - A duplicated tool list runs the review; an extra or missing tool aborts. - Configured caps reach the claude argv and the cap-reached messages; bad values are rejected at config load and fail the lane before any review. - The not-found message names the npm install route.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1941
Five follow-ups to the consult claude lane, found by the live review after it moved to the installed
claudeCLI (#1912).Problem → root cause → fix
api-keymode.assertLoggedInalways saidRun `claude auth login`, and a review result sayingNot logged in · Please run /loginwas quoted with no remedy beyond the CLI's own/login. Inapi-keymode the fix is the key. A newclaudeLoginRemedy(mode, source)gives the remedy for the mode:claude auth logininloginmode; inapi-keymode it namesconsult.claudeAuthand the file that set it, and says to check the key or remove the setting. It is used by the preflight, bycodev doctor, and byclassifyClaudeRunwhen an error result says the session is not logged in. Probed on the realclaude2.1.330: with any key set (even a bogus one)auth statusreportsloggedIn: true, so the preflight branch is defensive today. With no login, a print-mode run ends withNot logged in · Please run /login(is_error: true, subtypesuccess).tools.length === 3. It now compares sets: the session must report exactlyRead,Glob,Grep. A duplicate is fine; an extra tool (the security half) or a missing tool still aborts.CLAUDE_INSTALL_HINTnow names both routes (native installer andnpm install -g @anthropic-ai/claude-code), likeCLAUDE_UPDATE_HINT.consult.claudeMaxTurns(positive integer, default 200) andconsult.claudeMaxBudgetUsd(positive number, default 25), validated at config load besideclaudeAuth; a bad value fails loudly. The cap-reached messages name the configured value and the key to raise.claude2.1.141 minimum.consult.md(both trees), the consultSKILL.md(all four copies) and thearch.mdlane row say that withholding the API key is a billing guarantee, not secrecy: the reviewer can still read the workspace.envwith its Read tool.consult.mddocuments the two new keys.Also in this PR:
shipped-skill-hashes.tsregenerated for theSKILL.mdedit (theskill-refreshtest requires it).Noticed, not changed: when the lane is called directly with an invalid config, it throws in
resolveLaneModelChoicebefore itstry, so a stale--outputfile survives. That is already true for a badclaudeAuth, and realconsultloads config before any lane runs.Testing
codev doctor); an unrelated error result gets no remedy; a duplicated tool list runs the review, while an extra or missing tool aborts; configured caps reach theclaudeargv and the cap messages; bad cap values are rejected at config load and fail the lane before any review; the not-found message names npm.claude-cli.test.ts,claude-cli-lane.test.tsanddoctor.test.tspass: 209 passed, 1 skipped.tsc --noEmitis clean.Flaky Tests
The full suite, run locally through porch's
testscheck, failed four times, each time on a different test. The load average was 29–54 from other workspaces (once 14 at the start, rising to 39 during the run). None of these tests touches this change, and each passes alone:src/__tests__/windows-console-spawn-guard.test.tssrc/agent-farm/__tests__/ide-command.test.tssrc/agent-farm/__tests__/bugfix-1267-launch-loop.test.tssrc/commands/consult/__tests__/agy-auth-cache.test.tsThis draft PR is open so CI runs the full suite on a clean runner. porch's local
testscheck has not passed.